package com.xintonghua.hongyi.ui.user;

import android.os.Bundle;
import android.support.design.widget.TabLayout;

import com.jcodecraeer.xrecyclerview.XRecyclerView;
import com.xintonghua.base.ui.BaseActivity;
import com.xintonghua.base.utils.MyUtils;
import com.xintonghua.base.utils.RefreshUtils;
import com.xintonghua.hongyi.R;
import com.xintonghua.hongyi.adapter.OrderAdapter;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 作者：wanxianyi
 * 时间：2018/1/24.
 * 包名：com.xintonghua.hongyi.ui.user
 */

public class OrderListActivity extends BaseActivity implements XRecyclerView.LoadingListener {
    @BindView(R.id.tab_order)
    TabLayout tabOrder;
    @BindView(R.id.lv_order)
    XRecyclerView lvOrder;
    String[] title = new String[]{"全部", "待使用", "待评价", "已取消"};
    private OrderAdapter adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_order_list);
        ButterKnife.bind(this);
        onSimpleActionBar();
        setSimpleActionBar("我的订单");
        initUI();
    }

    @Override
    public void initUI() {
        super.initUI();
        for (String s : title) {
            tabOrder.addTab(tabOrder.newTab().setText(s));
        }
        RefreshUtils.initList(this, lvOrder, MyUtils.dip2px(this,4),R.color.grey_bg);
        adapter = new OrderAdapter(this, new ArrayList<String>());
        lvOrder.setAdapter(adapter);
        lvOrder.setLoadingListener(this);


    }

    @Override
    public void onRefresh() {

    }

    @Override
    public void onLoadMore() {

    }
}
